package com.wnn.demo.model.hospital.mapper;

import com.wnn.demo.domain.Employee;
import com.wnn.demo.utils.IBaseMapper;
import com.wnn.demo.vo.EmployeeJobs;
import com.wnn.demo.vo.EmployeeVo;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* Created by Mybatis Generator on 2019/10/28
*/
public interface EmployeeMapper extends IBaseMapper< Employee > {


    /**
     * 查找员工列表
     * @return
     */
    List <EmployeeVo> selectEmployeeList(@Param("searchEmployee") String searchEmployee
            , @Param("hospitalId") String hospitalId, @Param("deptChildId") String deptChildId
            , @Param("employeeIdView") String employeeIdView, @Param("isCheck") String isCheck);

    /**
     * 查找所有员工的工作信息
     * @return
     */
    List< Map< String, Object>> selectEmployeeJobInfo( );

    /**
     * 查找员工个人信息
     * @param username
     * @return
     */
    Map< String, Object> findEmployeeInfo(@Param("username") String username);


    int testBatchEmployeeByIds(@Param("keys") List< String> keys);


    List< Map< String, Object>> findHospitalAndDept(@Param("hId") String hId, @Param("type") Integer type, @Param("pDeptId") String pDeptId);

    /**
     * 给hd_employee增加员工关联医院部门 和职位信息 的中间记录表
     */
    int insertHdAndEmp(@Param("hdEmployeeId") String hdEmployeeId, @Param("hdId") String hdId, @Param("eId") String eId, @Param("jId") Integer jId);

    /**
     * 批量添加员工的工作信息 添加 hd_employee表
     */
    void insertEmployeeJobList(@Param("list") ArrayList<EmployeeJobs> updateEmployeeJobList);

    /**
     * 批量更新员工的工作信息 更新 hd_employee表
     */
    void updateEmployeeJobList(@Param("list") ArrayList<EmployeeJobs> updateEmployeeJobList);

    /**
     * 查询 表hosp_dept中所有医院信息
     */
    List<Map<String, String>> selectHospDeptList();

    /**
     * 批量删除 hd_employee 表信息
     */
    void btachDeleteEmployeeJobList(@Param("employeeId") String employeeId, @Param("list") List<String> deleteHdeIds);
}